package org.jeecg.modules.demo.yhs.Service;

import org.jeecg.modules.demo.yhs.mapper.VipMapper;
import org.jeecg.modules.demo.yhs.POJO.Vip;
import org.jeecg.modules.demo.yhs.POJO.Vipproportion;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Date;
import java.util.List;

@Service
public class VipServiceImpl implements VipService {
    @Autowired
    VipMapper vipMapper;

    public List<Vip> findnewDay() {
        Date s=new Date(System.currentTimeMillis());
        return  vipMapper.findByDate(s);
    }

    public Vipproportion findtype() {
        Vipproportion s=new Vipproportion();
        int  cout=vipMapper.findAll();
        s.setAlluser(cout);
        int a=vipMapper.findByType(1);
        s.setVip(a);
        int b=vipMapper.findByType(2);
        s.setCardvip(b);
        int c=vipMapper.findByType(3);
        s.setConsumervip(c);

        return s;
    }
}
